﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace BTSZap
{
    internal static class PropertyInfoHelper
    {
        public static T GetFirstAttribute<T>(PropertyInfo info) where T:Attribute
        {
            T[] attrs = (T[])info.GetCustomAttributes(typeof(T), false);
            if (attrs.Length > 0)
            {
                return attrs[0];
            }
            else
                return null;
        }
    }
}
